/*
 * Created by SharpDevelop.
 * user: Robertux
 * Date: 18/03/2008
 * Time: 19:21
 * 
 * 
 */

using System;
using System.Drawing;
using System.Windows.Forms;

namespace WinApp
{
	/// <summary>
	/// Description of frmAddEditValue.
	/// </summary>
	public partial class frmAddEditValue : Form
	{
		private DialogResult _result;
		
		public DialogResult Result
		{
			get { return this._result; }
		}
		
		public string Value
		{
			get { return this.txtValue.Text; }
		}
		
		public frmAddEditValue()
		{
			InitializeComponent();
		}
		
		public frmAddEditValue(string frmTitle, string defValue): this()
		{
			this.Text = frmTitle;
			this.txtValue.Text = defValue;
			this._result = DialogResult.Cancel;
			this.button1.Enabled = false;
		}
		
		void Button1Click(object sender, EventArgs e)
		{
			this._result = DialogResult.OK;
			this.Close();
		}
		
		void TxtValueTextChanged(object sender, EventArgs e)
		{
			if(this.txtValue.Text == "")
				this.button1.Enabled = false;
			else
				this.button1.Enabled = true;
		}
	}
}
